<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript">
			function shu() {
				if(document.getElementById("s0").style.visibility == "hidden") {
					document.getElementById("s0").style.visibility = "visible";
				} else {
					document.getElementById("s0").style.visibility = "hidden";
				}
			}

			function quan(x) {
				var all = document.getElementsByName("quan");
				for(var i = 0; i < all.length; i++) {
					all[i].checked = x.checked;
				}
			}

			function hau() {
				var input = document.getElementsByName("t");
				var str = "";
				for(var i = 0; i < input.length; i++) {
					str += input[i].value + "<br />"
				}
				document.getElementById("a").innerHTML = str;
			}
		</script>
	</head>

	<body>

		<div onclick="shu()">
			<h3>树形菜单:</h3>
			<h4>文学艺术：</h4>
			<ul style="visibility: hidden;" id="s0">
				<li>先锋艺术</li>
				<li>小说散文</li>
				<li>诗歌词韵</li>
			</ul>
		</div>

		<div>
			<h3><input type="checkbox" name="quan" onchange="quan(this)"/>全选</h3>
			<input type="checkbox" name="quan" />
			<input type="checkbox" name="quan" />
			<input type="checkbox" name="quan" />
			<input type="checkbox" name="quan" />
			<input type="checkbox" name="quan" />
			<input type="checkbox" name="quan" />
			<input type="checkbox" name="quan" />
			<input type="checkbox" value="8" name="qua" />
			<input type="checkbox" value="9" name="qua" />
			<input type="checkbox" value="10" name="qua" />
			<input type="checkbox" value="11" name="qua" />
			<input type="button" value="All" onclick="quan()" />
		</div>

		<div>
			<ul>
				<li><input type="text" name="t" value="chun" /></li>
				<li><input type="text" name="t" value="xia" /></li>
				<li><input type="text" name="t" value="qiu" /></li>
				<li><input type="text" name="t" value="dong" /></li>
				<li><input type="button" name="tb" value="hua" onclick="hau()" /></li>
				<h2 id="a"></h2>
			</ul>
		</div>

		<form name="sele">
			<select name="year" onchange="return daycheck()">
				<script type="text/javascript">
					for(var i = 1900; i <= 2016; i++) {
						document.write('<option value=' + i + '>' + i + '</option>')
					}
				</script>
			</select>
			<select name="month" onchange="return daycheck()">
				<script type="text/javascript">
					for(var j = 1; j <= 12; j++) {
						document.write('<option value=' + j + '>' + j + '</option>')
					}
				</script>
			</select>
			<select name="day"></select>
				<script type="text/javascript">
					function daycheck() {
						var yearNo, minthNo, dayNo;
						yearNo = document.sele.year.value;
						minthNo = document.sele.month.value;

						if(minthNo == 1 || minthNo == 3 || minthNo == 5 || minthNo == 7 || minthNo == 8 || minthNo == 10 || minthNo == 12) {
							dayNo = 31;
						} else if(minthNo == 2) {
							if(isRun(yearNo)) {
								dayNo = 29;
							} else {
								dayNo = 28;
							}

						} else {
							dayNo = 30;
						}
						document.sele.day.length = dayNo;
						for(var i = 0; i <= dayNo-1; i++) {
							document.sele.day[i] = new Option(i+1);//新建下拉框的选项
							document.sele.day[i].value = i+1;   //给下拉宽选项赋值
						}
					}

					function isRun(yearNo) {
						if((yearNo % 4 == 0 && yearNo % 100 != 0) || yearNo % 400 == 0) {
							return true;
						} else {
							return false;
						}
					}
					daycheck();
				</script>
		
		</form>

	</body>

</html>